package com.donlim.dev.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.donlim.dev.dto.LoginParams;
import com.donlim.dev.dto.PageInfoDto;
import com.donlim.dev.dto.sql.SQLParams;
import com.donlim.dev.entity.SysUser;
import com.baomidou.mybatisplus.extension.service.IService;
import com.donlim.dev.exception.SysUserException;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 星
 * @since 2020-11-03
 */
public interface SysUserService extends IService<SysUser> {

    /**
     * 登录
     * @param userCode
     * @param password
     * @return
     */
   String login(String userCode, String password) throws SysUserException;

    /**
     * 分页查询
     * @param sqlParams
     * @return
     */
   PageInfoDto<SysUser> list(SQLParams sqlParams);

    /**
     * 工号加载用户信息
     * @param userCode
     * @return
     */
   SysUser loadUserByUserCode(String userCode) throws SysUserException;

    /**
     * 获取用户信息
     * @param request 包含token
     * @return
     */
   SysUser getUserInfo(HttpServletRequest request) throws SysUserException;

}
